import { pluginManager } from "./video_plugin_manager";
async function main() {
    await pluginManager.setup();
    const plugin = pluginManager.getPlugins()[0];


    const result = await plugin.methods.search("", 1, "cartoon");
    // console.log(result);
    const first = result.data[1];
    const introduce = await plugin.methods.fetchIntroduceInfo({
        id: first.id,
        url:first.detailUrl
    });
    console.log(introduce);

    const detail = await plugin.methods.fetchVideoDetailInfo({
        id: introduce.id,
        url:introduce.detailUrl,
    });
    console.log(detail);

    // let url = "https://www.ylys.tv/voddetail/119503/";
    // // let url = "https://www.xb6v.com/e/DownSys/play/?classid=1&id=27102&pathid1=1&bf=0";


    // const res = await fetch(url,{
    //     headers: {
    //         "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
    //     }, 
    // });
    // const html = await res.text();

    // console.log(html);

}

main().catch(err => {
    console.error(err);
    process.exit(1);
});
